Skip to content

fix(skills): restore worktree step in brainstorming workflow#675

Open
qishaoyumu wants to merge 2 commits intoobra:mainfrom
qishaoyumu:fix/worktree-workflow-gap
Open

fix(skills): restore worktree step in brainstorming workflow#675
qishaoyumu wants to merge 2 commits intoobra:mainfrom
qishaoyumu:fix/worktree-workflow-gap

Conversation

@qishaoyumu
Copy link

@qishaoyumu qishaoyumu commented Mar 10, 2026

Summary

  • Restore the using-git-worktrees invocation lost during brainstorming skill
    simplification (8e38ab8, 7f2ee61) and still missing after the v5.0.0 rework
  • Fix stale "Phase 4" cross-reference in using-git-worktrees Integration section
  • Align actual workflow with writing-plans expectation that brainstorming
    creates a worktree (line 16)

Problem

brainstorming never invokes using-git-worktrees, despite writing-plans
expecting it (line 16: "This should be run in a dedicated worktree (created by
brainstorming skill)."
) and using-git-worktrees documenting it (line 212:
"Called by: brainstorming (Phase 4)").

In practice, after brainstorming completes, writing-plans runs directly in
the main working tree — no workspace isolation occurs.

Changes

skills/brainstorming/SKILL.md (4 edits):

  • Checklist: insert step 7 Set up worktree between Write design doc
    and Transition to implementation
  • Process flow diagram: add worktree node with correct edges
  • Terminal state note: expand skill whitelist to include
    using-git-worktrees
  • After the Design: add Workspace isolation section between Spec Review
    Loop and Implementation; adjust Implementation prohibition from
    "any other skill" to "any implementation skill (frontend-design,
    mcp-builder, etc.)" so using-git-worktrees is not blocked

skills/using-git-worktrees/SKILL.md (1 edit):

  • Integration: fix stale "Phase 4" cross-reference → "Step 7"

Context

This is a re-implementation of #483 against the v5.0.0 codebase. The original
PR was closed as stale after v5.0.0 substantially reworked the brainstorming
skill (Visual Companion, Scope Assessment, Spec Review Loop). The core intent
is the same — restore the missing worktree step — but adapted to v5.0.0's
expanded checklist (step 7 instead of 6) and refined prohibition wording. All
v5.0.0 features are unaffected.

Related: #483 (original PR, closed as stale)
Closes #574
Ref #186

Test Plan

  • Invoke brainstorming skill and verify worktree step appears in task
    checklist as step 7
  • After design approval, verify using-git-worktrees is invoked before
    writing-plans
  • Verify using-git-worktrees Integration section references "Step 7"
  • Confirm v5.0.0 features (Visual Companion, Spec Review Loop) still
    work normally

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

📝 Walkthrough

Walkthrough

Inserted a mandatory "Set up worktree (using-git-worktrees)" step into the brainstorming flow between design-doc creation and invoking writing-plans, updated the process graph and terminal-state wording, and added a "Workspace isolation" section and guidance requiring isolation before plan-writing.

Changes

Cohort / File(s) Summary
Brainstorming workflow
skills/brainstorming/SKILL.md
Added "Set up worktree (using-git-worktrees)" step before invoking writing-plans; updated workflow graph and terminal-state text; added "Workspace isolation" section and updated implementation guidance to require worktree isolation and prohibit invoking implementation skills after isolation.
Git worktree integration
skills/using-git-worktrees/SKILL.md
Adjusted Integration label/positioning to "Step 7 - REQUIRED after writing design doc, before invoking writing-plans" to align with the revised brainstorming sequence.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant Brain as Brainstorming Skill
  participant WG as using-git-worktrees Skill
  participant WP as writing-plans Skill

  User->>Brain: Start brainstorming / write design doc
  Brain->>User: Ask "User reviews spec?"
  alt User approves
    Brain->>WG: Set up worktree (using-git-worktrees)
    WG-->>Brain: Worktree created
    Brain->>WP: Invoke writing-plans (operate in worktree)
    WP-->>Brain: Plans written (isolated)
  else User requests changes
    Brain->>User: Continue brainstorming
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I dug a neat branch where ideas can play,
A worktree bed to keep the main path away,
Designs rest cozy, plans sprout without fright,
Safe little hops from morning to night. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: restoring a missing worktree step in the brainstorming workflow, which is the core objective of this PR.
Description check ✅ Passed The description is detailed and directly related to the changeset, clearly explaining the problem, changes made, and providing context and test plan.
Linked Issues check ✅ Passed The PR successfully restores the using-git-worktrees invocation in the brainstorming workflow (by inserting as step 9, updating cross-references, and expanding terminal-state whitelist), directly addressing issue #574's requirement for worktree creation after design doc writing and before writing-plans execution.
Out of Scope Changes check ✅ Passed All changes are in-scope: the worktree step insertion, cross-reference update, whitelist expansion, and Workspace isolation section are all necessary components of restoring the worktree workflow and fixing the stale cross-reference.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can suggest fixes for GitHub Check annotations.

Configure the reviews.tools.github-checks setting to adjust the time to wait for GitHub Checks to complete.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
skills/brainstorming/SKILL.md (1)

62-62: Approve with optional wording refinement suggestion.

The guidance correctly establishes the terminal state and skill invocation boundaries. The intent is clear: after design approval, only using-git-worktrees and writing-plans should be invoked, with no other implementation skills allowed.

📝 Optional wording refinement for precision

The phrase "after brainstorming" might be slightly ambiguous since using-git-worktrees is step 7 of the brainstorming checklist. Consider:

-**The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skills you invoke after brainstorming are using-git-worktrees (for workspace isolation) then writing-plans.
+**The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skills you invoke from brainstorming are using-git-worktrees (for workspace isolation) then writing-plans.

This clarifies that these skills are invoked as part of the brainstorming workflow, not after it completes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/brainstorming/SKILL.md` at line 62, Update the wording that currently
reads "The terminal state is invoking writing-plans. Do NOT invoke
frontend-design, mcp-builder, or any other implementation skill. The ONLY skills
you invoke after brainstorming are using-git-worktrees (for workspace isolation)
then writing-plans." to remove ambiguity around "after brainstorming":
explicitly state that within the brainstorming workflow (specifically step 7 of
the brainstorming checklist) the only allowed follow-up skills are
using-git-worktrees and then writing-plans, and that no other implementation
skills (e.g., frontend-design, mcp-builder) should be invoked at that point;
reference the exact phrase "The terminal state is invoking writing-plans." and
the skill names "using-git-worktrees" and "writing-plans" so reviewers can
locate and replace the sentence with a clearer version indicating these skills
are invoked as part of the brainstorming steps rather than only after
completion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@skills/brainstorming/SKILL.md`:
- Line 62: Update the wording that currently reads "The terminal state is
invoking writing-plans. Do NOT invoke frontend-design, mcp-builder, or any other
implementation skill. The ONLY skills you invoke after brainstorming are
using-git-worktrees (for workspace isolation) then writing-plans." to remove
ambiguity around "after brainstorming": explicitly state that within the
brainstorming workflow (specifically step 7 of the brainstorming checklist) the
only allowed follow-up skills are using-git-worktrees and then writing-plans,
and that no other implementation skills (e.g., frontend-design, mcp-builder)
should be invoked at that point; reference the exact phrase "The terminal state
is invoking writing-plans." and the skill names "using-git-worktrees" and
"writing-plans" so reviewers can locate and replace the sentence with a clearer
version indicating these skills are invoked as part of the brainstorming steps
rather than only after completion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 08bbb055-9fd5-4c70-878c-f1ef2971caca

📥 Commits

Reviewing files that changed from the base of the PR and between 33e55e6 and 5d2079a.

📒 Files selected for processing (2)
  • skills/brainstorming/SKILL.md
  • skills/using-git-worktrees/SKILL.md

@qishaoyumu
Copy link
Author

Re: CodeRabbit nitpick on "after brainstorming" → "from brainstorming"

Thanks for the suggestion. I considered this but decided to keep "after brainstorming" because:

  1. It matches the existing pattern — the original maintainer-written text uses the same phrase: "The ONLY skill you invoke after brainstorming is writing-plans."
  2. "from brainstorming" could be misread as "the only skills brainstorming ever invokes," which is inaccurate — brainstorming also invokes elements-of-style and spec-document-reviewer during earlier steps.

Happy to revisit if the maintainer prefers different wording.

The brainstorming skill never invoked using-git-worktrees despite
writing-plans expecting to run in a worktree "created by brainstorming
skill" and using-git-worktrees listing brainstorming as a caller.

This was unintentionally dropped during workflow simplification
(8e38ab8, 7f2ee61) and remained missing after v5.0.0 rework.

Changes to skills/brainstorming/SKILL.md:
- Checklist: insert step 7 (Set up worktree) between design doc and
  writing-plans
- Process flow diagram: add worktree node with correct edges
- Terminal state note: update skill whitelist to include
  using-git-worktrees
- After the Design: add Workspace isolation section, adjust
  Implementation prohibition from "any other skill" to
  "any implementation skill (frontend-design, mcp-builder, etc.)"

Changes to skills/using-git-worktrees/SKILL.md:
- Integration: fix stale "Phase 4" reference to "Step 7"

Closes obra#574
Ref obra#186
@qishaoyumu qishaoyumu force-pushed the fix/worktree-workflow-gap branch from 5d2079a to 6079cd2 Compare March 12, 2026 03:21
@qishaoyumu
Copy link
Author

Rebased onto latest main to resolve conflicts. The upstream added spec review loop (steps 7-8) since this PR was opened. Updated this PR to insert the worktree step as step 9 (after spec review and user review gate), and updated the cross-reference in using-git-worktrees/SKILL.md accordingly.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
skills/brainstorming/SKILL.md (1)

136-140: Add an explicit “verify worktree active” check before invoking writing-plans.

Right now it requires invoking using-git-worktrees, but doesn’t explicitly require confirming the session is actually in the new worktree before proceeding. Adding that check would further harden the #574 failure mode.

Suggested doc tweak
 **Workspace isolation:**

 - Invoke using-git-worktrees to create an isolated worktree for implementation
 - This ensures implementation work doesn't affect the main working tree
+- Verify you are now operating inside the created worktree/branch before continuing

 **Implementation:**

 - Invoke the writing-plans skill to create a detailed implementation plan
 - Do NOT invoke any implementation skill (frontend-design, mcp-builder, etc.). writing-plans is the next step after workspace isolation.

Also applies to: 144-145

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/brainstorming/SKILL.md` around lines 136 - 140, The documentation
currently instructs invoking using-git-worktrees before running writing-plans
but lacks an explicit verification step that the session is in the new worktree;
update the SKILL.md content around the "Workspace isolation" section to require
and describe an explicit "verify worktree active" check (e.g., run git worktree
list or check GIT_WORK_TREE/GIT_DIR/environment or a provided helper)
immediately after using-git-worktrees and before calling writing-plans so the
flow confirms the active worktree and aborts if not active; reference the
commands/helpers using-git-worktrees and writing-plans in the text so readers
know where to add the check.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@skills/brainstorming/SKILL.md`:
- Around line 136-140: The documentation currently instructs invoking
using-git-worktrees before running writing-plans but lacks an explicit
verification step that the session is in the new worktree; update the SKILL.md
content around the "Workspace isolation" section to require and describe an
explicit "verify worktree active" check (e.g., run git worktree list or check
GIT_WORK_TREE/GIT_DIR/environment or a provided helper) immediately after
using-git-worktrees and before calling writing-plans so the flow confirms the
active worktree and aborts if not active; reference the commands/helpers
using-git-worktrees and writing-plans in the text so readers know where to add
the check.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1ff1f8c5-dcde-40af-a429-ab2c57f6ae73

📥 Commits

Reviewing files that changed from the base of the PR and between 6079cd2 and a2a4b9b.

📒 Files selected for processing (1)
  • skills/brainstorming/SKILL.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git worktree is not created sometime after brainstorming

1 participant